home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 28
/
028.d81
/
loan calc
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
7KB
|
204 lines
1 dimg$(75)
5 def fnr(x)=int(100*x+.5)/100:bk$="[164]":printchr$(142);
7 gosub600
10 print"[147][129] loan calculator "
20 print"no. of months: [157][157][157][157]";bk$;:mo=2:nc=4:gosub60500:n=val(a$)
30 ifval(a$)=.thenprint"[145][145][145][145][145]";:goto20
60 print"interest rate %: [157][157][157][157][157]";bk$;:mo=130:nc=5:gosub60500:ar=val(a$)
70 ifval(a$)=.thenprint"[145][145][145]";:goto60
80 mr=ar/1200
90 print"principal: [157][157][157][157][157][157][157][157][157][157][157][157][157][157][157]";bk$;:nc=15:gosub60500
95 p=val(a$):ifval(a$)=.thenprint"[145][145][145]";:goto90
96 print"month of first pmt (1 to 12): [157][157]";bk$;:mo=2:nc=2:gosub60500
97 mt=val(a$):ifval(a$)<1orval(a$)>12thenprint"[145][145]";:goto96
98 print"year of 1st payment: [157][157][157][157]";bk$;:mo=2:nc=4:gosub60500:yr=val(a$)
99 ifval(a$)=.thenprint"[145][145][145]";:goto98
100 pmt=(p*mr)/(1-(1+mr)^(-n))
105 pmt=fnr(pmt)
110 print"payment=",fnr(pmt)
111 print"press return key once"
112 print"to continue and again to pause":mo=mt
113 geta$:if a$="" then113
115 print"[147]pmt # int amt prin amt bal due "
120 ta=0:tb=0:k=0:np=p:ny=yr
125 for i=1ton
132 geta$:ifa$=""then140
134 geta$:ifa$<>""then134
136 geta$:ifa$=""then136
140 ip=np*mr
145 pp=pmt-fnr(ip)
150 np=np-pp
155 ai=ai+ip
160 ifi=nthenpp=pp+np:np=0.00
162 cp=cp+pp
165 print i;tab(8);fnr(ip);tab(18);fnr(pp);tab(29);fnr(np)
167 ifi=nthenprint"final payment=";fnr(pp+ip)
170 ta=ta+fnr(ip):rem accumulates int.pd.
175 tb=tb+fnr(pp):rem accumulates prin. pd.
177 ifi=n+1then215
180 ifi=13-mothengosub800:goto210
185 k=k+1:ifk=12thengosub800
210 nexti
215 gosub800
220 print"[147] f1 [146] to see again f5 [146] to quit"
230 print" f3 [146] to do another f7 [146] printed copy"
235 getb$:ifb$=""then235
240 ifb$="[133]"then300:rem f1
250 ifb$="[134]"thenclr:goto5:rem f3
260 ifb$="[135]"then60000
270 ifb$="[136]"then400
280 goto235
300 np=p:ai=0:ny=yr:cp=0:goto110
400 rem data to printer
405 print"[147][129] send to printer "
410 print"is printer on and ready?"
415 print"name of this document (75 char limit)":print
420 print"=>";bk$;:nc=75:qq=mo:mo=190:gosub60500:f$=a$:mo=qq
425 iflen(f$)>75thenprint"[144]name too long, try again[156]":goto420
430 open15,4,15:close15:ifst=0then439
432 print"hold on, your printer isn't online!"
434 print"check the cables and try it again."
435 print"press [return].
436 [161]a$:[139]a$[179][177][199](13)[167]436
437 [137]220
439 [153]"hold on while i talk to the printer."
440 [159]1,4
445 [157]1
450 [152]1,f$
455 [152]1,"monthly payment: ";pmt;[199](16)"30amount of loan: ";p
460 [152]1," pmt # interest pmt principal pmt balance due"
462 ta[178]0:tb[178]0:k[178]0:np[178]p
463 cp[178]0:ai[178]0:ny[178]yr
465 [129]i[178]1[164]n
470 ip[178]np[172]mr
475 pp[178]pmt[171][165]r(ip)
480 np[178]np[171]pp
485 ai[178]ai[170]ip
490 [139]i[178]n[167]pp[178]pp[170]np:np[178]0
492 cp[178]cp[170]pp
495 [152]1,i;[199](16)"10";[165]r(ip);[199](16)"30";
496 [152]1,[165]r(pp);[199](16)"50";[165]r(np)
497 [139]i[178]n[167][152]1,"final payment=";[165]r(pp[170]ip)
500 ta[178]ta[170][165]r(ip):[143] accumulates int pd.
505 tb[178]tb[170][165]r(pp):[143] accumulates prin pd.
507 [139]i[178]n[167]540
510 [139]i[178]13[171]mt[167][141]900:[137]530
520 k[178]k[170]1:[139]k[178]12[167][141]900
530 [130]i
540 [141]900
550 [160]1:l[178]0:[153]"load":[137]220
600 [143] title
605 [151]53281,15:[151]53280,11
610 [153]"load(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)"
615 [153]"(NULL)(NULL)(NULL)(NULL)(NULL) loan calculator wait(NULL)(NULL)(NULL)(NULL)(NULL)"
620 [153]"(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)"
625 [153]"this program will calculate loans and"
630 [153]"mortgages and make a printout on paper."
635 [153]"the printer program is written to skip"
640 [153]"15 lines from one sheet to another when"
645 [153]"using the 1525 printer. this may have"
650 [153]"to be changed for other printers. see"
655 [153]"lines 950 and 980."
657 [153]"just follow the simple instructions"
660 [153]"given by the prompts.stop (hit any key)"
690 [161]a$:[139]a$[178]""[167]690
695 [142]
800 [153]"totototototototototototototototototototototototototototototototototototototototo"
810 [153]"ontotalswait":[153]"yr";ny:ny[178]ny[170]1
840 [153]"on"[163]8);ta;[163]18);tb
845 [153]"accum"[163]8);[165]r(ai);[163]18);[165]r(cp)
850 [153]" press [return] to continue, q to quit"
855 [161]a$:[139]a$[178][199](13)[167]858
856 [139]a$[178]"q"[176]a$[178]"(NULL)"[167]220
857 [137]855
858 [153]"on "
860 ta[178]0:tb[178]0:k[178]0
870 [153]"pmt # int amt prin amt bal due "
880 [142]
900 [152]1,"---------------------------";
905 [152]1,"--------------------------------------"
910 [152]1," totals wait"
920 [152]1,ny;[199](16)"10";ta;[199](16)"30";tb
930 [152]1,"accum";[199](16)"10";[165]r(ai);[199](16)"30";[165]r(cp)
935 [152]1,"---------------------------";
937 [152]1,"--------------------------------------"
940 ny[178]ny[170]1
950 l[178]l[170]1:[139]l[178]3[176]l[178]6[176]l[178]9[176]l[178]12[176]l[178]15[176]l[178]18[176]l[178]21[176]l[178]24[176]l[178]27[167][141]980
955 ta[178]0:tb[178]0:k[178]0
960 [142]
980 [129]s[178]1[164]15:[152]1:[130]
990 [152]1," pmt # interest pmt principal pmt balance due"
995 [142]
60000 [159]15,8,15,"r0:hello connect=hello connect"
60005 [132]15,er:[160]15:[139]er[179][177]63[167][128]
60010 [153]"load";:[147]"hello connect",8
60100 pn$[178]"(NULL)(NULL)atn(NULL) lenatn(NULL)len(NULL)(NULL)atn(NULL)(NULL)(NULL)":an$[178]"peek(NULL): (NULL). (NULL). (NULL)val(NULL)(NULL)(NULL)(NULL)"
60110 bo[178]02:sc[178]10:cl[178]06:c1[178]05:c2[178]02:c3[178]05:c4[178]02:c5[178]00:c6[178]00:c7[178]00
60120 [143] bo - border color
60121 [143] sc - screen color
60122 [143] cl - color poked on border
60123 [143] c1 - top box outside color
60124 [143] c2 - top box inside color
60125 [143] c3 - bottom box outside color
60126 [143] c4 - bottom box inside color
60127 [143] c5 - 'copyright' color
60128 [143] c6 - 'program name' color
60129 [143] c7 - 'authors name' color
60130 [151]53280,bo:[151]53281,sc:[153]"load";
60140 [151]646,c1:[153]" totototototototototototototototototototototototototototototototototototo"
60150 [151]646,c2:[153]" fn (NULL)(NULL)atnstr$(NULL)(NULL)atn(NULL) (NULL)(NULL)val(NULL)val(NULL)(NULL)(NULL): then"
60170 [151]646,c1:[153]" tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab("
60180 [151]646,c6:[153]""[163]20[171][195](pn$)[173]2);pn$
60190 [151]646,c7:[153]""[163]20[171][195](an$)[173]2);an$
60200 [151]646,c5:[153]""[163]13)"len(NULL)(NULL)(NULL)(NULL)right$chr$left$(NULL) 1986"
60210 [153][163]9)"len(NULL)(NULL)(NULL)(NULL)str$(NULL)(NULL)val (NULL)(NULL)peek(NULL)right$lenatn(NULL)right$(NULL)(NULL)(NULL)"
60220 [151]646,c3:[153]" totototototototototototototototototototototototototototototototototototo"
60230 [151]646,c4:[153]" fn then"
60240 [151]646,c3:[153]" tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(":le[178]1044:ri[178]1043
60250 [151]le,98:[151]ri,98:le[178]le[171]1:ri[178]ri[170]1
60260 co[178]54272:[151]ri[170]co,cl:[151]le[170]co,cl
60270 [139]le[178]1025[167]60290
60280 [137]60250
60290 [151]le,108:[151]ri,123:[151]le[170]co,cl:[151]ri[170]co,cl:[151]646,cl
60300 le[178]le[170]40:ri[178]ri[170]40:[139]le[178]1985[167]60330
60305 [139]le[178]1185[167][153]"usrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusr"
60306 [139]le[178]1825[167][153]"andandandandandandandan